#include "calendardialog.h"

CalendarDialog::CalendarDialog()
{
    init();
}
CalendarDialog::CalendarDialog(const Glib::ustring&  title, bool modal, bool use_separator)
    :Dialog(title,modal,use_separator)
{
    init();
}
CalendarDialog::~CalendarDialog()
{
    //dtor
}
void CalendarDialog::init()
{
    set_default_size(400,250);
    add_button(Gtk::Stock::OK,1);
    add_button(Gtk::Stock::CANCEL,0);
    set_default_response(0);
    get_vbox()->add(m_calendar);
    m_calendar.signal_day_selected_double_click().connect(sigc::mem_fun(*this,&CalendarDialog::on_response));
    get_vbox()->show_all();
}
void CalendarDialog::get_date(Glib::Date& date) const
{
    m_calendar.get_date(date);
}
void CalendarDialog::get_date(guint& year, guint& month, guint& day) const
{
    m_calendar.get_date(year,month,day);
}
void CalendarDialog::on_response()
{
    response(Gtk::RESPONSE_OK);
}
